package com.me.libgdx_test;

import java.util.Random;

import com.badlogic.gdx.graphics.Color;

public class ClassAnimationString {
	private String text;
	private Point string_location;
	private int frames, font_size, current_frame;
	private Color color;
	private boolean animation_over, location_converted;
	private Random random = new Random(System.currentTimeMillis());
	ClassAnimationString(String text, Point string_location, int frames, int font_size, Color color){
		this.text = text;
		this.string_location = new Point(string_location);
		this.frames = frames;
		this.current_frame = 0;
		this.font_size = font_size;
		this.color = color;
		animation_over = false;
		location_converted = false;
	}
	public boolean location_converted(){
		return location_converted;
	}
	public boolean animation_over(){
		return animation_over;
	}
	public Point get_location(){
		return string_location;
	}
	public void convert_location(Point new_location){
		string_location = new_location;
		location_converted = true;
	}
	public ClassHudText get_animation_frame(){
		current_frame++;
		if(current_frame >= frames){
			animation_over = true;
		}
		
		int random_pick = random.nextInt(2);
		
		if(random_pick==0){
			string_location.x--;
		}else if(random_pick == 1){
			string_location.x++;
		}
		
		string_location.y++;
		
		return new ClassHudText(string_location, text, font_size, color);
	}
}
